package model;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

import view.StackFragment;


public class MessageTest {

	
	CardStack cs;
	
	
	Card spadeTwo;
	Card heartKing;
	
	
	StackFragment sf;
	
	@Before
	public void setup()
	{
		cs = new CardStack(0,0);
		
		spadeTwo = new Card(2,Suit.SPADE);
		heartKing = new Card(13, Suit.HEART);
		
		
		sf = new StackFragment(cs, 0);
	}
	
	
	
	@Test
	public void cardstackTest()
	{
		cs.push(heartKing);
		
		
		Assert.assertEquals("cardstack%0#0#true#[13-HEART]", cs.toMessage());

		cs.push(spadeTwo);
		Assert.assertEquals("cardstack%0#0#true#[13-HEART,2-SPADE]", cs.toMessage());
		
	}
	
	@Test
	public void stackFragmentTest()
	{
		
		Assert.assertEquals("stackfragment%0#cardstack%0#0#true#[]", sf.toMessage());
		
		cs.push(heartKing);
		Assert.assertEquals("stackfragment%0#cardstack%0#0#true#[13-HEART]", sf.toMessage());

		sf.top = 5;
		Assert.assertEquals("stackfragment%5#cardstack%0#0#true#[13-HEART]", sf.toMessage());
		
	}
	
	@Test
	public void rpcTest()
	{
		
		
	}
	
}
